package com.cloud.util;

import java.util.Date;

public class TimeAnalysis {
    long startTime, endTime;

    public void start() {
        startTime = System.currentTimeMillis();
        System.out.println("Time Analysis");
        System.out.println("start: " + new Date(startTime));
        System.out.println("--------------------------------------------------");
    }

    public void end() {
        endTime = System.currentTimeMillis();
        long second = (endTime - startTime) / 1000;
        System.out.println("--------------------------------------------------");
        System.out.println("end: " + new Date(endTime));
        System.out.println("tasks take " + (second / 60) + " min " + (second % 60) + " s");
    }
}
